<?php 
namespace app\modules\user\models;
use app\libs\Pager;
use yii\db\ActiveRecord;
class MockUser extends ActiveRecord {
    public $cateData;

    public static function tableName(){
            return '{{%mock_info}}';
    }

    public function getMockUser($where,$pageSize = 10,$page =1){
        $offset = ($page-1)*$pageSize;
        $data=self::find()->from('x2_mock_info mi')->select('u.userName,u.phone,mi.createTime,wx,score,status,mi.id')->asArray()->leftJoin('x2_user u','mi.uid=u.uid')->where($where)->offset($offset)->limit($pageSize)->orderBy('id desc')->all();
        $count = self::find()->from('x2_mock_info mi')->select('u.userName,mi.*')->asArray()->leftJoin('x2_user u','mi.uid=u.uid')->where($where)->count();
        return ['data' => $data,'count' => $count];
    }
}
